package com.digitalchina.lxnsy.activity.old;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.base.BaseActivity;
import com.digitalchina.lxnsy.entity.TrainingVO;
import com.digitalchina.lxnsy.toolkit.GotoUtil;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.activity
 * 创建人：郑皓
 * 创建时间：2017/2/27 15:50
 * 修改备注：
 * ================================================
 */
public class TrainingDetailActivity extends BaseActivity {

    @Bind(R.id.training_detail_tv_name)
    TextView trainingDetailTvName;
    @Bind(R.id.training_detail_tv_person)
    TextView trainingDetailTvPerson;
    @Bind(R.id.training_detail_tv_date)
    TextView trainingDetailTvDate;
    @Bind(R.id.training_detail_tv_place)
    TextView trainingDetailTvPlace;
    @Bind(R.id.training_detail_tv_start_time)
    TextView trainingDetailTvStartTime;
    @Bind(R.id.training_detail_tv_end_time)
    TextView trainingDetailTvEndTime;
    @Bind(R.id.training_detail_ll_QR_code)
    LinearLayout trainingDetailLlQRCode;

    private TrainingVO trainingVO;

    @Override
    public void setLayout() {
        setContentLayout(R.layout.activity_training_detail);
        setTitle("培训详情");
    }

    @Override
    public void initMember() {

        trainingVO = (TrainingVO) getIntent().getSerializableExtra("TrainingVO");

        if (trainingVO == null)
            return;

        trainingDetailTvName.setText(trainingVO.getTitle());
        trainingDetailTvPerson.setText(trainingVO.getExpertName());
        trainingDetailTvDate.setText(trainingVO.getTraindate());
        trainingDetailTvPlace.setText(trainingVO.getTrainaddress());
        trainingDetailTvStartTime.setText(trainingVO.getStarttime());
        trainingDetailTvEndTime.setText(trainingVO.getEndtime());
    }

    @Override
    public void addListener() {

        trainingDetailLlQRCode.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                GotoUtil.gotoActivity(TrainingDetailActivity.this, TrainingQRCodeActivity.class, "TrainingVO", trainingVO);
            }
        });
    }

    @Override
    public void setHandler() {

    }

    @Override
    public void callBack(Object object) {

    }

    @Override
    public void rightOnClick() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
